<template>
  <div class="common-details">
    <customDetailsTopbar :title="active + '详情'" flag @back="back" />
    <div class="d-scroll listInner px-1">
      <div class="py-1 px-1 bg-white ">
        <component :is="currentComponent" />
      </div>
    </div>
  </div>
</template>

<script>
import reportingManager from './components/reportingManager'
import dataDisplay from './components/dataDisplay'

export default {
  components: { dataDisplay, reportingManager },
  data() {
    return {
      active: '',
      current: '',
      currentComponent: '',
      comMap: {
        '数据展示': 'dataDisplay',
        '报告管理': 'reportingManager'
      }
    }
  },
  mounted() {
    this.active = this.$route.query.tag
    this.current = this.$route.query.current
    this.currentComponent = this.comMap[this.$route.query.tag]
  },
  methods: {
    back() {
      this.$router.push({
        path: '/staging/emissionData',
        query: { current: this.current, tag: this.active }
      })
    }
  }
}
</script>
